package com.helloUIBinder.service;

import com.helloUIBinder.model.BlogPost;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Service
public class TestTask {

    @Autowired
    BlogPostManager blogPostManager;

//    @Scheduled(fixedRate = 3000)
//    @Transactional
//    public void executePeriodically() {
//        BlogPost blogPost = new BlogPost();
//        blogPost.setTheme("Sheduler works!");
//        blogPost.setOwner("Sheduler works!");
//        blogPostManager.saveBlogPost(blogPost);
//        System.out.println("The time is now : " + new Date());
//    }
}
